#include "skip_data.h"

int main(void)
{
	slice* sl;
	RECPOS pos[128];
	int i;
	data_desc* dp = skipD_open("..//data.dat", 12, 32);
	for(i=0; i<8; i++)
	{
		slice sl = {(byte*)(&i), sizeof(i)};
		pos[i] = skipD_write(dp, &sl);
	}
	
	sl = skipD_read(dp, pos[3]);
	printf("value = %d\n", *((int*)sl->buf));
	
	sl =skipD_read(dp, pos[0]);
	printf("value = %d\n", *((int*)sl->buf));


	skipD_del(dp, pos[0]);
	skipD_del(dp, pos[5]);

	for(i=8; i<11; i++)
	{
		slice sl = {(byte*)(&i), sizeof(i)};
		pos[i] = skipD_write(dp, &sl);
	}
	skipD_close(dp);
	mem_print();
	return 0;
}
